import { getRequest, postRequest, putRequest } from '@/utils/request'

export const orderApi = {
  // 下单接口
  createOrder: (params = {}) => {
    return postRequest('/v1/auth/order/pay', params)
  },

  // 继续支付
  continuePay: (params = {}) => {
    return postRequest('/v1/auth/order/continue/pay', params)
  },

  // 取消支付
  cancelOrder: (params = {}) => {
    return putRequest('/v1/auth/order/cancel', params)
  },

  // 支付结果
  payResult: (params) => {
    return getRequest('/v1/auth/order/result', params)
  },

  // 订单信息
  orderInfoView: (params) => {
    return getRequest('/v1/auth/order/view', params)
  },

  // 用户中心-我的订单
  orderPage: (params = {}) => {
    return getRequest('/v1/auth/order/page', params)
  }
}
